import {createApp} from 'vue'
import App from './App.vue'
import router from "./router/router";
import i18n from "./i18n";
import VueMarkdownEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
import enUS from '@kangc/v-md-editor/lib/lang/en-US';
import zhCn from "@kangc/v-md-editor/lib/lang/zh-CN";
import Prism from 'prismjs';
// 文章预览组件
import VMdPreview from '@kangc/v-md-editor/lib/preview';
import '@kangc/v-md-editor/lib/style/preview.css';
// 基于断点隐藏
import 'element-plus/theme-chalk/display.css'
VMdPreview.use(vuepressTheme, {
    Prism,
});
// 判断编辑器语言
if (window.localStorage.getItem('language') === 'en') {
    VueMarkdownEditor.lang.use('en-US', enUS);
} else {
    VueMarkdownEditor.lang.use('zh-CN', zhCn);
}
VueMarkdownEditor.use(vuepressTheme, {
    Prism,
});


const app = createApp(App)
app.use(i18n).use(VueMarkdownEditor).use(VMdPreview)
app.use(router).mount('#app')
